package ge.telasi.tasks.model.copy;

import ge.telasi.tasks.model.CopyService;
import ge.telasi.tasks.model.Structure;

/**
 * @author dimitri
 */
public class StructureCopy extends CopyService<Structure> {

    @Override
    public Structure createClone(Structure proto) {
        Structure struct = new Structure();
        copyModifiable(proto, struct);
        struct.setId(proto.getId());
        struct.setName(copyString(proto.getName()));
        struct.setName2(copyString(proto.getName2()));
        if (struct.getParent() != null) {
            struct.setParent(createClone(struct.getParent()));
        }
        struct.setType(proto.getType());
        return struct;
    }

}
